Skip to content

feat(check): verify full-disk encryption + flag memory-store location - #26

Merged
sandstream merged 1 commit into
mainfrom
feat/check-disk-encryption
Jun 22, 2026
Merged

sandstream merged 1 commit into
mainfrom
feat/check-disk-encryption

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Why

kit's local state — ~/.kit/memory.db (secret-dense; it indexes raw transcripts) and materialized .env.local — is plaintext at rest, protected only by 0600 perms. For a security tool going public, "a stolen laptop exposes every cached secret" is the worst headline.

Full app-level encryption of the live FTS5 DB is a large, risky change (node:sqlite has no SQLCipher; encrypting content breaks full-text search) — deliberately not rushed here. The correct at-rest control for a whole secret-dense store is OS full-disk encryption, so this PR verifies it.

What

New src/check-disk-encryption.ts, wired into kit check security results:

  • checkDiskEncryption() — verifies FDE is on per-OS: FileVault (fdesetup status), BitLocker (manage-bde -status), LUKS (lsblk → crypt). Warns (high severity) when off; fail-open (skips on unknown OS / missing command / CI — not the at-rest threat model).
  • checkMemoryDirSafety() — flags the KIT_MEMORY_DIR foot-gun: if the secret-dense store is redirected into a git working tree it could be committed.

Pure interpreter/helper functions are unit-tested (6/6); check-security suite still green (9/9).

Follow-up (tracked, not in scope)

Application-level at-rest encryption of memory.db (design doc first — reuse the AES-256-GCM primitive already in memory/backup.ts, solve the FTS5-over-ciphertext problem).

🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg


Generated by Claude Code

kit's local state (~/.kit/memory.db, .env.local) is secret-dense and plaintext
at rest. The correct at-rest control for a whole secret-dense store is OS
full-disk encryption. Add a deterministic, fail-open check that verifies FDE is
on (FileVault / LUKS / BitLocker) and warns loudly if not, plus a check that
flags a KIT_MEMORY_DIR redirected into the repo working tree (committable
secret-dense DB). Wired into `kit check` security results. Zero-LLM, skips in CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 996afaa into main Jun 22, 2026
15 of 16 checks passed
@sandstream
sandstream deleted the feat/check-disk-encryption branch June 22, 2026 07:38
@sandstream sandstream mentioned this pull request Jun 22, 2026
sandstream added a commit that referenced this pull request Jun 22, 2026
Cut 1.13.0 from the 11 PRs merged since v1.12.0. Backfilled the CHANGELOG
entries that landed without one (full-disk-encryption check #26, secrets
validate + env diff #28, .gitignore shared-memory fix #24, ~30k-line
dead-code flush #27/#30) and dated the section. Minor bump: all additive
or dead-code removal, nothing breaking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants